package com.ydc.ln.tutorial.mail.it315;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;

public class Demo {
	public static void main(String[] args) throws UnknownHostException, IOException {
		Socket sock = new Socket("smtp.163.com", 25);
		
		BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream()));
		//System.out.println(br.readLine());
		OutputStream out = sock.getOutputStream();
		out.write("ehlo yangdachao\t\n".getBytes());
		for (int i=0; i<7; i++) {
			System.out.println(br.readLine());
		}
	}
}
